<template>
  <div>
    <button @click="hAddRoutes">动态添加路由</button>
  </div>
</template>

<script>
export default {
  methods: {
    hAddRoutes() {
      this.$router.addRoutes(
        [{
          path: '/demo',
          component: () => import('@/views/demo/index.vue')
        }]
      )
    }
  }
}
</script>

<style>

</style>
